package com.crrc.yzt.demo.base

import android.os.Bundle
import android.widget.Toast
import androidx.annotation.ColorRes
import androidx.appcompat.app.AppCompatActivity
import com.crrc.yzt.demo.blue.R
import com.crrc.yzt.demo.utils.StatusBarUtils

open class BaseActivity: AppCompatActivity() {


    var mActivity:AppCompatActivity?= null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mActivity = this
        setStatusBarBackground()
    }


    fun showToast(msg:String){
        Toast.makeText(this,msg,Toast.LENGTH_SHORT).show()
    }

    /**
     * 设置状态栏背景色
     */
    fun setStatusBarBackground(@ColorRes statusBarColor: Int = R.color.white) {
        StatusBarUtils.setStatusBarBackground(this, statusBarColor)
    }


    fun setStatusBarTransparent(isDarkFont:Boolean = true) {
        StatusBarUtils.setStatusBarTransparent(this,isDarkFont)
    }
}